A HProgress chart with custom title

With this chart the title is not drawn using the title property - instead it is drawn using the ondraw custom event along with the RGraph.Text() API function.

[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.hprogress.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="600" height="100">
    [No canvas support]
</canvas>
This is the code that generates the chart:
<script>
    window.onload = function ()
    {
        var hprogress = new RGraph.HProgress({
            id: 'cvs',
            min: 0,
            max: 100,
            value: 89,
            options: {
                textAccessible: true
            }
        }).on('draw', function (obj)
        {
            obj.context.fillStyle = 'black';
            
            RGraph.Text2(obj, {
                font: 'Arial',
                italic: true,
                size: 16,
                x: obj.canvas.width / 2,
                y: obj.Get('gutter.top') - 5,
                text: 'A custom title drawn with the ondraw event',
                valign: 'bottom',
                halign: 'center'
            });
        }).draw();
    };
</script>